@extends('mostrar')
@section('content')
<div class="modal-content">
  <div class="modal-header modal-header-factura">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
    <h3 class="modal-title" id="myModalLabel"><i class="fa fa-shopping-cart fa-2x"></i>  Factura N°: <strong>{{$venta->num_factura}}</strong></h3>
  </div>
  <div class="modal-body">
  {{--*/$cliente = ClienteProveedor::where('id',$venta->id_cliente)->first()/*--}}
    <table class="pull-left col-md-8 ">
         <tbody id="factura">
             <tr>
                 <td class=""><strong>Fecha:</strong></td>
                 <td>{{$venta->fecha}}</td>
                 
             </tr>
             <tr>
                 <td class=""><strong>Cliente:</strong></td>
                 <td>{{$cliente->nombre}}</td>
             </tr>
             <tr>
                 <td class=""><strong>RUC:</strong></td>
                 <td>{{$cliente->ruc}} </td>
             </tr>

             <tr>
                 <td class=""><strong>Contacto:</strong></td>
                 <td>{{$venta->contacto}} </td>
                 
             </tr>
            
             <tr>
                 <td class="btn-mais-info text-primary">
                     <i class="open_info fa fa-plus-square-o"></i>
                     <i class="open_info hide fa fa-minus-square-o"></i> Más Detalles
                 </td>
                 <td> </td>
                 <td class="h5"></td>
             </tr> 

         </tbody>
    </table>
             
      {{--IMAGENES--}}   
    <div class="col-md-4"> 
        <img src="" alt="" class="img-thumbnail">  
    </div>
    {{--IMAGENES--}} 

    <div class="clearfix"></div>

     {{-- VER MAS --}} 
<div class="table-responsive">

      <table class="table table-striped">
        <tr>
            <th>Sexo</th>
            <th>Color</th>
            <th>Raza</th>
            <th>Tipo</th>
            <th>Precio x Kg</th>
            <th>Peso</th>
            <th>Monto</th>
        </tr>
        
       
	        @foreach(Detalleventa::where('id_ventas',$venta->id)->get() as $detalle)
		      <tr>
		      	{{--*/
		      	$ganado = Ganado::where('id',$detalle->id_ganado)->first()
		      	/*--}}
		        <td>{{$ganado->sexo}}</td>
		        <td>{{$ganado->color}}</td>
		        <td>{{$ganado->id_raza}}</td>
		        <td>{{$ganado->id_tipo}}</td>
		        <td>{{$detalle->precio_kilo}}</td>
		        <td> {{$detalle->peso}}</td>
		        <td>{{$detalle->precio_bruto}}</td>
	     	  </tr>
     		@endforeach
        
    </table>

  </div>

                  </div>
                    
                  <div class="modal-footer">       
                      
                    <div class="text-right pull-right col-md-3">
                        Total: <br/> 
                        <span class="h3 text-muted" id="total_bruto"><strong>{{$venta->total}}</strong></span></span> 
                    </div> 
                      
                    <div class="text-right pull-right col-md-3">
                       Sub Total: <br/> 
                        <span class="h3 text-muted" id="total"><strong>{{$venta->total_bruto}}</strong></span>
                    </div>
                     
                </div>
              </div>
            </div>
            </div>  

@stop